// android app

// +build android

package app

/*
#include <android/input.h>
extern int cgoCallback(int fd, int events, void* data);
*/
import "C"

import "unsafe"

/*
 * Key states (may be returned by queries about the current state of a
 * particular key code, scan code or switch).
 */
const (
	/* The key state is unknown or the requested key itself is not supported. */
	KEY_STATE_UNKNOWN = C.AKEY_STATE_UNKNOWN

	/* The key is up. */
	KEY_STATE_UP = C.AKEY_STATE_UP

	/* The key is down. */
	KEY_STATE_DOWN = C.AKEY_STATE_DOWN

	/* The key is down but is a virtual key press that is being emulated by the system. */
	KEY_STATE_VIRTUAL = C.AKEY_STATE_VIRTUAL
)

/*
 * Meta key / modifer state.
 */
const (
	/* No meta keys are pressed. */
	META_NONE = C.AMETA_NONE

	/* This mask is used to check whether one of the ALT meta keys is pressed. */
	META_ALT_ON = C.AMETA_ALT_ON

	/* This mask is used to check whether the left ALT meta key is pressed. */
	META_ALT_LEFT_ON = C.AMETA_ALT_LEFT_ON

	/* This mask is used to check whether the right ALT meta key is pressed. */
	META_ALT_RIGHT_ON = C.AMETA_ALT_RIGHT_ON

	/* This mask is used to check whether one of the SHIFT meta keys is pressed. */
	META_SHIFT_ON = C.AMETA_SHIFT_ON

	/* This mask is used to check whether the left SHIFT meta key is pressed. */
	META_SHIFT_LEFT_ON = C.AMETA_SHIFT_LEFT_ON

	/* This mask is used to check whether the right SHIFT meta key is pressed. */
	META_SHIFT_RIGHT_ON = C.AMETA_SHIFT_RIGHT_ON

	/* This mask is used to check whether the SYM meta key is pressed. */
	META_SYM_ON = C.AMETA_SYM_ON

	/* This mask is used to check whether the FUNCTION meta key is pressed. */
	META_FUNCTION_ON = C.AMETA_FUNCTION_ON

	/* This mask is used to check whether one of the CTRL meta keys is pressed. */
	META_CTRL_ON = C.AMETA_CTRL_ON

	/* This mask is used to check whether the left CTRL meta key is pressed. */
	META_CTRL_LEFT_ON = C.AMETA_CTRL_LEFT_ON

	/* This mask is used to check whether the right CTRL meta key is pressed. */
	META_CTRL_RIGHT_ON = C.AMETA_CTRL_RIGHT_ON

	/* This mask is used to check whether one of the META meta keys is pressed. */
	META_META_ON = C.AMETA_META_ON

	/* This mask is used to check whether the left META meta key is pressed. */
	META_META_LEFT_ON = C.AMETA_META_LEFT_ON

	/* This mask is used to check whether the right META meta key is pressed. */
	META_META_RIGHT_ON = C.AMETA_META_RIGHT_ON

	/* This mask is used to check whether the CAPS LOCK meta key is on. */
	META_CAPS_LOCK_ON = C.AMETA_CAPS_LOCK_ON

	/* This mask is used to check whether the NUM LOCK meta key is on. */
	META_NUM_LOCK_ON = C.AMETA_NUM_LOCK_ON

	/* This mask is used to check whether the SCROLL LOCK meta key is on. */
	META_SCROLL_LOCK_ON = C.AMETA_SCROLL_LOCK_ON
)

/*
 * Input events.
 *
 * Input events are opaque structures.  Use the provided accessors functions to
 * read their properties.
 */
type InputEvent C.AInputEvent

func (event *InputEvent) cptr() *C.AInputEvent {
	return (*C.AInputEvent)(event)
}

/*
 * Input event types.
 */
const (
	/* Indicates that the input event is a key event. */
	INPUT_EVENT_TYPE_KEY = C.AINPUT_EVENT_TYPE_KEY

	/* Indicates that the input event is a motion event. */
	INPUT_EVENT_TYPE_MOTION = C.AINPUT_EVENT_TYPE_MOTION
)

/*
 * Key event actions.
 */
const (
	/* The key has been pressed down. */
	KEY_EVENT_ACTION_DOWN = C.AKEY_EVENT_ACTION_DOWN

	/* The key has been released. */
	KEY_EVENT_ACTION_UP = C.AKEY_EVENT_ACTION_UP

	/* Multiple duplicate key events have occurred in a row, or a complex string is
	 * being delivered.  The repeat_count property of the key event contains the number
	 * of times the given key code should be executed.
	 */
	KEY_EVENT_ACTION_MULTIPLE = C.AKEY_EVENT_ACTION_MULTIPLE
)

/*
 * Key event flags.
 */
const (
	/* This mask is set if the device woke because of this key event. */
	KEY_EVENT_FLAG_WOKE_HERE = C.AKEY_EVENT_FLAG_WOKE_HERE

	/* This mask is set if the key event was generated by a software keyboard. */
	KEY_EVENT_FLAG_SOFT_KEYBOARD = C.AKEY_EVENT_FLAG_SOFT_KEYBOARD

	/* This mask is set if we don't want the key event to cause us to leave touch mode. */
	KEY_EVENT_FLAG_KEEP_TOUCH_MODE = C.AKEY_EVENT_FLAG_KEEP_TOUCH_MODE

	/* This mask is set if an event was known to come from a trusted part
	 * of the system.  That is, the event is known to come from the user,
	 * and could not have been spoofed by a third party component. */
	KEY_EVENT_FLAG_FROM_SYSTEM = C.AKEY_EVENT_FLAG_FROM_SYSTEM

	/* This mask is used for compatibility, to identify enter keys that are
	 * coming from an IME whose enter key has been auto-labelled "next" or
	 * "done".  This allows TextView to dispatch these as normal enter keys
	 * for old applications, but still do the appropriate action when
	 * receiving them. */
	KEY_EVENT_FLAG_EDITOR_ACTION = C.AKEY_EVENT_FLAG_EDITOR_ACTION

	/* When associated with up key events, this indicates that the key press
	 * has been canceled.  Typically this is used with virtual touch screen
	 * keys, where the user can slide from the virtual key area on to the
	 * display: in that case, the application will receive a canceled up
	 * event and should not perform the action normally associated with the
	 * key.  Note that for this to work, the application can not perform an
	 * action for a key until it receives an up or the long press timeout has
	 * expired. */
	KEY_EVENT_FLAG_CANCELED = C.AKEY_EVENT_FLAG_CANCELED

	/* This key event was generated by a virtual (on-screen) hard key area.
	 * Typically this is an area of the touchscreen, outside of the regular
	 * display, dedicated to "hardware" buttons. */
	KEY_EVENT_FLAG_VIRTUAL_HARD_KEY = C.AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY

	/* This flag is set for the first key repeat that occurs after the
	 * long press timeout. */
	KEY_EVENT_FLAG_LONG_PRESS = C.AKEY_EVENT_FLAG_LONG_PRESS

	/* Set when a key event has AKEY_EVENT_FLAG_CANCELED set because a long
	 * press action was executed while it was down. */
	KEY_EVENT_FLAG_CANCELED_LONG_PRESS = C.AKEY_EVENT_FLAG_CANCELED_LONG_PRESS

	/* Set for AKEY_EVENT_ACTION_UP when this event's key code is still being
	 * tracked from its initial down.  That is, somebody requested that tracking
	 * started on the key down and a long press has not caused
	 * the tracking to be canceled. */
	KEY_EVENT_FLAG_TRACKING = C.AKEY_EVENT_FLAG_TRACKING

	/* Set when a key event has been synthesized to implement default behavior
	 * for an event that the application did not handle.
	 * Fallback key events are generated by unhandled trackball motions
	 * (to emulate a directional keypad) and by certain unhandled key presses
	 * that are declared in the key map (such as special function numeric keypad
	 * keys when numlock is off). */
	KEY_EVENT_FLAG_FALLBACK = C.AKEY_EVENT_FLAG_FALLBACK
)

/*
 * Motion event actions.
 */

/* Bit shift for the action bits holding the pointer index as
 * defined by AMOTION_EVENT_ACTION_POINTER_INDEX_MASK.
 */
const MOTION_EVENT_ACTION_POINTER_INDEX_SHIFT = C.AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT

const (
	/* Bit mask of the parts of the action code that are the action itself.
	 */
	MOTION_EVENT_ACTION_MASK = C.AMOTION_EVENT_ACTION_MASK

	/* Bits in the action code that represent a pointer index, used with
	 * AMOTION_EVENT_ACTION_POINTER_DOWN and AMOTION_EVENT_ACTION_POINTER_UP.  Shifting
	 * down by AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT provides the actual pointer
	 * index where the data for the pointer going up or down can be found.
	 */
	MOTION_EVENT_ACTION_POINTER_INDEX_MASK = C.AMOTION_EVENT_ACTION_POINTER_INDEX_MASK

	/* A pressed gesture has started, the motion contains the initial starting location.
	 */
	MOTION_EVENT_ACTION_DOWN = C.AMOTION_EVENT_ACTION_DOWN

	/* A pressed gesture has finished, the motion contains the final release location
	 * as well as any intermediate points since the last down or move event.
	 */
	MOTION_EVENT_ACTION_UP = C.AMOTION_EVENT_ACTION_UP

	/* A change has happened during a press gesture (between AMOTION_EVENT_ACTION_DOWN and
	 * AMOTION_EVENT_ACTION_UP).  The motion contains the most recent point, as well as
	 * any intermediate points since the last down or move event.
	 */
	MOTION_EVENT_ACTION_MOVE = C.AMOTION_EVENT_ACTION_MOVE

	/* The current gesture has been aborted.
	 * You will not receive any more points in it.  You should treat this as
	 * an up event, but not perform any action that you normally would.
	 */
	MOTION_EVENT_ACTION_CANCEL = C.AMOTION_EVENT_ACTION_CANCEL

	/* A movement has happened outside of the normal bounds of the UI element.
	 * This does not provide a full gesture, but only the initial location of the movement/touch.
	 */
	MOTION_EVENT_ACTION_OUTSIDE = C.AMOTION_EVENT_ACTION_OUTSIDE

	/* A non-primary pointer has gone down.
	 * The bits in AMOTION_EVENT_ACTION_POINTER_INDEX_MASK indicate which pointer changed.
	 */
	MOTION_EVENT_ACTION_POINTER_DOWN = C.AMOTION_EVENT_ACTION_POINTER_DOWN

	/* A non-primary pointer has gone up.
	 * The bits in AMOTION_EVENT_ACTION_POINTER_INDEX_MASK indicate which pointer changed.
	 */
	MOTION_EVENT_ACTION_POINTER_UP = C.AMOTION_EVENT_ACTION_POINTER_UP

	/* A change happened but the pointer is not down (unlike AMOTION_EVENT_ACTION_MOVE).
	 * The motion contains the most recent point, as well as any intermediate points since
	 * the last hover move event.
	 */
	MOTION_EVENT_ACTION_HOVER_MOVE = C.AMOTION_EVENT_ACTION_HOVER_MOVE

	/* The motion event contains relative vertical and/or horizontal scroll offsets.
	 * Use getAxisValue to retrieve the information from AMOTION_EVENT_AXIS_VSCROLL
	 * and AMOTION_EVENT_AXIS_HSCROLL.
	 * The pointer may or may not be down when this event is dispatched.
	 * This action is always delivered to the winder under the pointer, which
	 * may not be the window currently touched.
	 */
	MOTION_EVENT_ACTION_SCROLL = C.AMOTION_EVENT_ACTION_SCROLL

	/* The pointer is not down but has entered the boundaries of a window or view.
	 */
	MOTION_EVENT_ACTION_HOVER_ENTER = C.AMOTION_EVENT_ACTION_HOVER_ENTER

	/* The pointer is not down but has exited the boundaries of a window or view.
	 */
	MOTION_EVENT_ACTION_HOVER_EXIT = C.AMOTION_EVENT_ACTION_HOVER_EXIT
)

/*
 * Motion event flags.
 */
const (
	/* This flag indicates that the window that received this motion event is partly
	 * or wholly obscured by another visible window above it.  This flag is set to true
	 * even if the event did not directly pass through the obscured area.
	 * A security sensitive application can check this flag to identify situations in which
	 * a malicious application may have covered up part of its content for the purpose
	 * of misleading the user or hijacking touches.  An appropriate response might be
	 * to drop the suspect touches or to take additional precautions to confirm the user's
	 * actual intent.
	 */
	MOTION_EVENT_FLAG_WINDOW_IS_OBSCURED = C.AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED
)

/*
 * Motion event edge touch flags.
 */
const (
	/* No edges intersected */
	MOTION_EVENT_EDGE_FLAG_NONE = C.AMOTION_EVENT_EDGE_FLAG_NONE

	/* Flag indicating the motion event intersected the top edge of the screen. */
	MOTION_EVENT_EDGE_FLAG_TOP = C.AMOTION_EVENT_EDGE_FLAG_TOP

	/* Flag indicating the motion event intersected the bottom edge of the screen. */
	MOTION_EVENT_EDGE_FLAG_BOTTOM = C.AMOTION_EVENT_EDGE_FLAG_BOTTOM

	/* Flag indicating the motion event intersected the left edge of the screen. */
	MOTION_EVENT_EDGE_FLAG_LEFT = C.AMOTION_EVENT_EDGE_FLAG_LEFT

	/* Flag indicating the motion event intersected the right edge of the screen. */
	MOTION_EVENT_EDGE_FLAG_RIGHT = C.AMOTION_EVENT_EDGE_FLAG_RIGHT
)

/*
 * Constants that identify each individual axis of a motion event.
 * Refer to the documentation on the MotionEvent class for descriptions of each axis.
 */
const (
	MOTION_EVENT_AXIS_X           = C.AMOTION_EVENT_AXIS_X
	MOTION_EVENT_AXIS_Y           = C.AMOTION_EVENT_AXIS_Y
	MOTION_EVENT_AXIS_PRESSURE    = C.AMOTION_EVENT_AXIS_PRESSURE
	MOTION_EVENT_AXIS_SIZE        = C.AMOTION_EVENT_AXIS_SIZE
	MOTION_EVENT_AXIS_TOUCH_MAJOR = C.AMOTION_EVENT_AXIS_TOUCH_MAJOR
	MOTION_EVENT_AXIS_TOUCH_MINOR = C.AMOTION_EVENT_AXIS_TOUCH_MINOR
	MOTION_EVENT_AXIS_TOOL_MAJOR  = C.AMOTION_EVENT_AXIS_TOOL_MAJOR
	MOTION_EVENT_AXIS_TOOL_MINOR  = C.AMOTION_EVENT_AXIS_TOOL_MINOR
	MOTION_EVENT_AXIS_ORIENTATION = C.AMOTION_EVENT_AXIS_ORIENTATION
	MOTION_EVENT_AXIS_VSCROLL     = C.AMOTION_EVENT_AXIS_VSCROLL
	MOTION_EVENT_AXIS_HSCROLL     = C.AMOTION_EVENT_AXIS_HSCROLL
	MOTION_EVENT_AXIS_Z           = C.AMOTION_EVENT_AXIS_Z
	MOTION_EVENT_AXIS_RX          = C.AMOTION_EVENT_AXIS_RX
	MOTION_EVENT_AXIS_RY          = C.AMOTION_EVENT_AXIS_RY
	MOTION_EVENT_AXIS_RZ          = C.AMOTION_EVENT_AXIS_RZ
	MOTION_EVENT_AXIS_HAT_X       = C.AMOTION_EVENT_AXIS_HAT_X
	MOTION_EVENT_AXIS_HAT_Y       = C.AMOTION_EVENT_AXIS_HAT_Y
	MOTION_EVENT_AXIS_LTRIGGER    = C.AMOTION_EVENT_AXIS_LTRIGGER
	MOTION_EVENT_AXIS_RTRIGGER    = C.AMOTION_EVENT_AXIS_RTRIGGER
	MOTION_EVENT_AXIS_THROTTLE    = C.AMOTION_EVENT_AXIS_THROTTLE
	MOTION_EVENT_AXIS_RUDDER      = C.AMOTION_EVENT_AXIS_RUDDER
	MOTION_EVENT_AXIS_WHEEL       = C.AMOTION_EVENT_AXIS_WHEEL
	MOTION_EVENT_AXIS_GAS         = C.AMOTION_EVENT_AXIS_GAS
	MOTION_EVENT_AXIS_BRAKE       = C.AMOTION_EVENT_AXIS_BRAKE
	MOTION_EVENT_AXIS_DISTANCE    = C.AMOTION_EVENT_AXIS_DISTANCE
	MOTION_EVENT_AXIS_TILT        = C.AMOTION_EVENT_AXIS_TILT
	MOTION_EVENT_AXIS_GENERIC_1   = C.AMOTION_EVENT_AXIS_GENERIC_1
	MOTION_EVENT_AXIS_GENERIC_2   = C.AMOTION_EVENT_AXIS_GENERIC_2
	MOTION_EVENT_AXIS_GENERIC_3   = C.AMOTION_EVENT_AXIS_GENERIC_3
	MOTION_EVENT_AXIS_GENERIC_4   = C.AMOTION_EVENT_AXIS_GENERIC_4
	MOTION_EVENT_AXIS_GENERIC_5   = C.AMOTION_EVENT_AXIS_GENERIC_5
	MOTION_EVENT_AXIS_GENERIC_6   = C.AMOTION_EVENT_AXIS_GENERIC_6
	MOTION_EVENT_AXIS_GENERIC_7   = C.AMOTION_EVENT_AXIS_GENERIC_7
	MOTION_EVENT_AXIS_GENERIC_8   = C.AMOTION_EVENT_AXIS_GENERIC_8
	MOTION_EVENT_AXIS_GENERIC_9   = C.AMOTION_EVENT_AXIS_GENERIC_9
	MOTION_EVENT_AXIS_GENERIC_10  = C.AMOTION_EVENT_AXIS_GENERIC_10
	MOTION_EVENT_AXIS_GENERIC_11  = C.AMOTION_EVENT_AXIS_GENERIC_11
	MOTION_EVENT_AXIS_GENERIC_12  = C.AMOTION_EVENT_AXIS_GENERIC_12
	MOTION_EVENT_AXIS_GENERIC_13  = C.AMOTION_EVENT_AXIS_GENERIC_13
	MOTION_EVENT_AXIS_GENERIC_14  = C.AMOTION_EVENT_AXIS_GENERIC_14
	MOTION_EVENT_AXIS_GENERIC_15  = C.AMOTION_EVENT_AXIS_GENERIC_15
	MOTION_EVENT_AXIS_GENERIC_16  = C.AMOTION_EVENT_AXIS_GENERIC_16

	// NOTE: If you add a new axis here you must also add it to several other files.
	//       Refer to frameworks/base/core/java/android/view/MotionEvent.java for the full list.
)

/*
 * Constants that identify buttons that are associated with motion events.
 * Refer to the documentation on the MotionEvent class for descriptions of each button.
 */
const (
	MOTION_EVENT_BUTTON_PRIMARY   = C.AMOTION_EVENT_BUTTON_PRIMARY
	MOTION_EVENT_BUTTON_SECONDARY = C.AMOTION_EVENT_BUTTON_SECONDARY
	MOTION_EVENT_BUTTON_TERTIARY  = C.AMOTION_EVENT_BUTTON_TERTIARY
	MOTION_EVENT_BUTTON_BACK      = C.AMOTION_EVENT_BUTTON_BACK
	MOTION_EVENT_BUTTON_FORWARD   = C.AMOTION_EVENT_BUTTON_FORWARD
)

/*
 * Constants that identify tool types.
 * Refer to the documentation on the MotionEvent class for descriptions of each tool type.
 */
const (
	MOTION_EVENT_TOOL_TYPE_UNKNOWN = C.AMOTION_EVENT_TOOL_TYPE_UNKNOWN
	MOTION_EVENT_TOOL_TYPE_FINGER  = C.AMOTION_EVENT_TOOL_TYPE_FINGER
	MOTION_EVENT_TOOL_TYPE_STYLUS  = C.AMOTION_EVENT_TOOL_TYPE_STYLUS
	MOTION_EVENT_TOOL_TYPE_MOUSE   = C.AMOTION_EVENT_TOOL_TYPE_MOUSE
	MOTION_EVENT_TOOL_TYPE_ERASER  = C.AMOTION_EVENT_TOOL_TYPE_ERASER
)

/*
 * Input sources.
 *
 * Refer to the documentation on android.view.InputDevice for more details about input sources
 * and their correct interpretation.
 */
const (
	INPUT_SOURCE_CLASS_MASK = C.AINPUT_SOURCE_CLASS_MASK

	INPUT_SOURCE_CLASS_NONE       = C.AINPUT_SOURCE_CLASS_NONE
	INPUT_SOURCE_CLASS_BUTTON     = C.AINPUT_SOURCE_CLASS_BUTTON
	INPUT_SOURCE_CLASS_POINTER    = C.AINPUT_SOURCE_CLASS_POINTER
	INPUT_SOURCE_CLASS_NAVIGATION = C.AINPUT_SOURCE_CLASS_NAVIGATION
	INPUT_SOURCE_CLASS_POSITION   = C.AINPUT_SOURCE_CLASS_POSITION
	INPUT_SOURCE_CLASS_JOYSTICK   = C.AINPUT_SOURCE_CLASS_JOYSTICK
)

const (
	INPUT_SOURCE_UNKNOWN = C.AINPUT_SOURCE_UNKNOWN

	INPUT_SOURCE_KEYBOARD         = C.AINPUT_SOURCE_KEYBOARD
	INPUT_SOURCE_DPAD             = C.AINPUT_SOURCE_DPAD
	INPUT_SOURCE_GAMEPAD          = C.AINPUT_SOURCE_GAMEPAD
	INPUT_SOURCE_TOUCHSCREEN      = C.AINPUT_SOURCE_TOUCHSCREEN
	INPUT_SOURCE_MOUSE            = C.AINPUT_SOURCE_MOUSE
	INPUT_SOURCE_STYLUS           = C.AINPUT_SOURCE_STYLUS
	INPUT_SOURCE_TRACKBALL        = C.AINPUT_SOURCE_TRACKBALL
	INPUT_SOURCE_TOUCHPAD         = C.AINPUT_SOURCE_TOUCHPAD
	INPUT_SOURCE_TOUCH_NAVIGATION = C.AINPUT_SOURCE_TOUCH_NAVIGATION
	INPUT_SOURCE_JOYSTICK         = C.AINPUT_SOURCE_JOYSTICK

	INPUT_SOURCE_ANY = C.AINPUT_SOURCE_ANY
)

/*
 * Keyboard types.
 *
 * Refer to the documentation on android.view.InputDevice for more details.
 */
const (
	INPUT_KEYBOARD_TYPE_NONE           = C.AINPUT_KEYBOARD_TYPE_NONE
	INPUT_KEYBOARD_TYPE_NON_ALPHABETIC = C.AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC
	INPUT_KEYBOARD_TYPE_ALPHABETIC     = C.AINPUT_KEYBOARD_TYPE_ALPHABETIC
)

/*
 * Input event accessors.
 *
 * Note that most functions can only be used on input events that are of a given type.
 * Calling these functions on input events of other types will yield undefined behavior.
 */

/*** Accessors for all input events. ***/

/* Get the input event type. */
//int32_t AInputEvent_getType(const AInputEvent* event);
func (event *InputEvent) GetType() int {
	return int(C.AInputEvent_getType(event.cptr()))
}

/* Get the id for the device that an input event came from.
 *
 * Input events can be generated by multiple different input devices.
 * Use the input device id to obtain information about the input
 * device that was responsible for generating a particular event.
 *
 * An input device id of 0 indicates that the event didn't come from a physical device;
 * other numbers are arbitrary and you shouldn't depend on the values.
 * Use the provided input device query API to obtain information about input devices.
 */
//int32_t AInputEvent_getDeviceId(const AInputEvent* event);
func (event *InputEvent) GetDeviceId() int {
	return int(C.AInputEvent_getDeviceId(event.cptr()))
}

/* Get the input event source. */
//int32_t AInputEvent_getSource(const AInputEvent* event);
func (event *InputEvent) GetSource() int {
	return int(C.AInputEvent_getSource(event.cptr()))
}

/*** Accessors for key events only. ***/
type KeyEvent InputEvent

func (event *KeyEvent) cptr() *C.AInputEvent {
	return (*InputEvent)(event).cptr()
}

/* Get the key event action. */
//int32_t AKeyEvent_getAction(const AInputEvent* key_event);
func (event *KeyEvent) GetAction() int {
	return int(C.AKeyEvent_getAction(event.cptr()))
}

/* Get the key event flags. */
//int32_t AKeyEvent_getFlags(const AInputEvent* key_event);
func (event *KeyEvent) GetFlags() int {
	return int(C.AKeyEvent_getFlags(event.cptr()))
}

/* Get the key code of the key event.
 * This is the physical key that was pressed, not the Unicode character. */
//int32_t AKeyEvent_getKeyCode(const AInputEvent* key_event);
func (event *KeyEvent) GetKeyCode() int {
	return int(C.AKeyEvent_getKeyCode(event.cptr()))
}

/* Get the hardware key id of this key event.
 * These values are not reliable and vary from device to device. */
//int32_t AKeyEvent_getScanCode(const AInputEvent* key_event);
func (event *KeyEvent) GetScanCode() int {
	return int(C.AKeyEvent_getScanCode(event.cptr()))
}

/* Get the meta key state. */
//int32_t AKeyEvent_getMetaState(const AInputEvent* key_event);
func (event *KeyEvent) GetMetaState() int {
	return int(C.AKeyEvent_getMetaState(event.cptr()))
}

/* Get the repeat count of the event.
 * For both key up an key down events, this is the number of times the key has
 * repeated with the first down starting at 0 and counting up from there.  For
 * multiple key events, this is the number of down/up pairs that have occurred. */
//int32_t AKeyEvent_getRepeatCount(const AInputEvent* key_event);
func (event *KeyEvent) GetRepeatCount() int {
	return int(C.AKeyEvent_getRepeatCount(event.cptr()))
}

/* Get the time of the most recent key down event, in the
 * java.lang.System.nanoTime() time base.  If this is a down event,
 * this will be the same as eventTime.
 * Note that when chording keys, this value is the down time of the most recently
 * pressed key, which may not be the same physical key of this event. */
//int64_t AKeyEvent_getDownTime(const AInputEvent* key_event);
func (event *KeyEvent) GetDownTime() int64 {
	return int64(C.AKeyEvent_getDownTime(event.cptr()))
}

/* Get the time this event occurred, in the
 * java.lang.System.nanoTime() time base. */
//int64_t AKeyEvent_getEventTime(const AInputEvent* key_event);
func (event *KeyEvent) GetEventTime() int64 {
	return int64(C.AKeyEvent_getEventTime(event.cptr()))
}

/*** Accessors for motion events only. ***/
type MotionEvent InputEvent

func (event *MotionEvent) cptr() *C.AInputEvent {
	return (*InputEvent)(event).cptr()
}

/* Get the combined motion event action code and pointer index. */
//int32_t AMotionEvent_getAction(const AInputEvent* motion_event);
func (event *MotionEvent) GetAction() int {
	return int(C.AMotionEvent_getAction(event.cptr()))
}

/* Get the motion event flags. */
//int32_t AMotionEvent_getFlags(const AInputEvent* motion_event);
func (event *MotionEvent) GetFlags() int {
	return int(C.AMotionEvent_getFlags(event.cptr()))
}

/* Get the state of any meta / modifier keys that were in effect when the
 * event was generated. */
//int32_t AMotionEvent_getMetaState(const AInputEvent* motion_event);
func (event *MotionEvent) GetMetaState() int {
	return int(C.AMotionEvent_getMetaState(event.cptr()))
}

/* Get the button state of all buttons that are pressed. */
//int32_t AMotionEvent_getButtonState(const AInputEvent* motion_event);
func (event *MotionEvent) GetButtonState() int {
	return int(C.AMotionEvent_getButtonState(event.cptr()))
}

/* Get a bitfield indicating which edges, if any, were touched by this motion event.
 * For touch events, clients can use this to determine if the user's finger was
 * touching the edge of the display. */
//int32_t AMotionEvent_getEdgeFlags(const AInputEvent* motion_event);
func (event *MotionEvent) GetEdgeFlags() int {
	return int(C.AMotionEvent_getEdgeFlags(event.cptr()))
}

/* Get the time when the user originally pressed down to start a stream of
 * position events, in the java.lang.System.nanoTime() time base. */
//int64_t AMotionEvent_getDownTime(const AInputEvent* motion_event);
func (event *MotionEvent) GetDownTime() int64 {
	return int64(C.AMotionEvent_getDownTime(event.cptr()))
}

/* Get the time when this specific event was generated,
 * in the java.lang.System.nanoTime() time base. */
//int64_t AMotionEvent_getEventTime(const AInputEvent* motion_event);
func (event *MotionEvent) GetEventTime() int64 {
	return int64(C.AMotionEvent_getEventTime(event.cptr()))
}

/* Get the X coordinate offset.
 * For touch events on the screen, this is the delta that was added to the raw
 * screen coordinates to adjust for the absolute position of the containing windows
 * and views. */
//float AMotionEvent_getXOffset(const AInputEvent* motion_event) __NDK_FPABI__;
func (event *MotionEvent) GetXOffset() float32 {
	return float32(C.AMotionEvent_getXOffset(event.cptr()))
}

/* Get the Y coordinate offset.
 * For touch events on the screen, this is the delta that was added to the raw
 * screen coordinates to adjust for the absolute position of the containing windows
 * and views. */
//float AMotionEvent_getYOffset(const AInputEvent* motion_event) __NDK_FPABI__;
func (event *MotionEvent) GetYOffset() float32 {
	return float32(C.AMotionEvent_getYOffset(event.cptr()))
}

/* Get the precision of the X coordinates being reported.
 * You can multiply this number with an X coordinate sample to find the
 * actual hardware value of the X coordinate. */
//float AMotionEvent_getXPrecision(const AInputEvent* motion_event) __NDK_FPABI__;
func (event *MotionEvent) GetXPrecision() float32 {
	return float32(C.AMotionEvent_getXPrecision(event.cptr()))
}

/* Get the precision of the Y coordinates being reported.
 * You can multiply this number with a Y coordinate sample to find the
 * actual hardware value of the Y coordinate. */
//float AMotionEvent_getYPrecision(const AInputEvent* motion_event) __NDK_FPABI__;
func (event *MotionEvent) GetYPrecision() float32 {
	return float32(C.AMotionEvent_getYPrecision(event.cptr()))
}

/* Get the number of pointers of data contained in this event.
 * Always >= 1. */
//size_t AMotionEvent_getPointerCount(const AInputEvent* motion_event);
func (event *MotionEvent) GetPointerCount() int64 {
	return int64(C.AMotionEvent_getPointerCount(event.cptr()))
}

/* Get the pointer identifier associated with a particular pointer
 * data index in this event.  The identifier tells you the actual pointer
 * number associated with the data, accounting for individual pointers
 * going up and down since the start of the current gesture. */
//int32_t AMotionEvent_getPointerId(const AInputEvent* motion_event, size_t pointer_index);
func (event *MotionEvent) GetPointerId(pointer_index int) int {
	return int(C.AMotionEvent_getPointerId(event.cptr(), C.size_t(pointer_index)))
}

/* Get the tool type of a pointer for the given pointer index.
 * The tool type indicates the type of tool used to make contact such as a
 * finger or stylus, if known. */
//int32_t AMotionEvent_getToolType(const AInputEvent* motion_event, size_t pointer_index);
func (event *MotionEvent) GetToolType(pointer_index int) int {
	return int(C.AMotionEvent_getToolType(event.cptr(), C.size_t(pointer_index)))
}

/* Get the original raw X coordinate of this event.
 * For touch events on the screen, this is the original location of the event
 * on the screen, before it had been adjusted for the containing window
 * and views. */
//float AMotionEvent_getRawX(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
func (event *MotionEvent) GetRawX(pointer_index int) float32 {
	return float32(C.AMotionEvent_getRawX(event.cptr(), C.size_t(pointer_index)))
}

/* Get the original raw X coordinate of this event.
 * For touch events on the screen, this is the original location of the event
 * on the screen, before it had been adjusted for the containing window
 * and views. */
//float AMotionEvent_getRawY(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
func (event *MotionEvent) GetRawY(pointer_index int) float32 {
	return float32(C.AMotionEvent_getRawY(event.cptr(), C.size_t(pointer_index)))
}

/* Get the current X coordinate of this event for the given pointer index.
 * Whole numbers are pixels; the value may have a fraction for input devices
 * that are sub-pixel precise. */
//float AMotionEvent_getX(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
func (event *MotionEvent) GetX(pointer_index int) float32 {
	return float32(C.AMotionEvent_getX(event.cptr(), C.size_t(pointer_index)))
}

/* Get the current Y coordinate of this event for the given pointer index.
 * Whole numbers are pixels; the value may have a fraction for input devices
 * that are sub-pixel precise. */
//float AMotionEvent_getY(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
func (event *MotionEvent) GetY(pointer_index int) float32 {
	return float32(C.AMotionEvent_getY(event.cptr(), C.size_t(pointer_index)))
}

/* Get the current pressure of this event for the given pointer index.
 * The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure),
 * although values higher than 1 may be generated depending on the calibration of
 * the input device. */
//float AMotionEvent_getPressure(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
func (event *MotionEvent) GetPressure(pointer_index int) float32 {
	return float32(C.AMotionEvent_getPressure(event.cptr(), C.size_t(pointer_index)))
}

/* Get the current scaled value of the approximate size for the given pointer index.
 * This represents some approximation of the area of the screen being
 * pressed; the actual value in pixels corresponding to the
 * touch is normalized with the device specific range of values
 * and scaled to a value between 0 and 1.  The value of size can be used to
 * determine fat touch events. */
//float AMotionEvent_getSize(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
func (event *MotionEvent) GetSize(pointer_index int) float32 {
	return float32(C.AMotionEvent_getSize(event.cptr(), C.size_t(pointer_index)))
}

/* Get the current length of the major axis of an ellipse that describes the touch area
 * at the point of contact for the given pointer index. */
//float AMotionEvent_getTouchMajor(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
func (event *MotionEvent) GetTouchMajor(pointer_index int) float32 {
	return float32(C.AMotionEvent_getTouchMajor(event.cptr(), C.size_t(pointer_index)))
}

/* Get the current length of the minor axis of an ellipse that describes the touch area
 * at the point of contact for the given pointer index. */
//float AMotionEvent_getTouchMinor(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
func (event *MotionEvent) GetTouchMinor(pointer_index int) float32 {
	return float32(C.AMotionEvent_getTouchMinor(event.cptr(), C.size_t(pointer_index)))
}

/* Get the current length of the major axis of an ellipse that describes the size
 * of the approaching tool for the given pointer index.
 * The tool area represents the estimated size of the finger or pen that is
 * touching the device independent of its actual touch area at the point of contact. */
//float AMotionEvent_getToolMajor(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
func (event *MotionEvent) GetToolMajor(pointer_index int) float32 {
	return float32(C.AMotionEvent_getToolMajor(event.cptr(), C.size_t(pointer_index)))
}

/* Get the current length of the minor axis of an ellipse that describes the size
 * of the approaching tool for the given pointer index.
 * The tool area represents the estimated size of the finger or pen that is
 * touching the device independent of its actual touch area at the point of contact. */
//float AMotionEvent_getToolMinor(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
func (event *MotionEvent) GetToolMinor(pointer_index int) float32 {
	return float32(C.AMotionEvent_getToolMinor(event.cptr(), C.size_t(pointer_index)))
}

/* Get the current orientation of the touch area and tool area in radians clockwise from
 * vertical for the given pointer index.
 * An angle of 0 degrees indicates that the major axis of contact is oriented
 * upwards, is perfectly circular or is of unknown orientation.  A positive angle
 * indicates that the major axis of contact is oriented to the right.  A negative angle
 * indicates that the major axis of contact is oriented to the left.
 * The full range is from -PI/2 radians (finger pointing fully left) to PI/2 radians
 * (finger pointing fully right). */
//float AMotionEvent_getOrientation(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
func (event *MotionEvent) GetOrientation(pointer_index int) float32 {
	return float32(C.AMotionEvent_getOrientation(event.cptr(), C.size_t(pointer_index)))
}

/* Get the value of the request axis for the given pointer index. */
//float AMotionEvent_getAxisValue(const AInputEvent* motion_event,
//        int32_t axis, size_t pointer_index) __NDK_FPABI__;
func (event *MotionEvent) GetAxisValue(axis, pointer_index int) float32 {
	return float32(C.AMotionEvent_getAxisValue(event.cptr(), C.int32_t(axis), C.size_t(pointer_index)))
}

/* Get the number of historical points in this event.  These are movements that
 * have occurred between this event and the previous event.  This only applies
 * to AMOTION_EVENT_ACTION_MOVE events -- all other actions will have a size of 0.
 * Historical samples are indexed from oldest to newest. */
//size_t AMotionEvent_getHistorySize(const AInputEvent* motion_event);
func (event *MotionEvent) GetHistorySize() int64 {
	return int64(C.AMotionEvent_getHistorySize(event.cptr()))
}

/* Get the time that a historical movement occurred between this event and
 * the previous event, in the java.lang.System.nanoTime() time base. */
//int64_t AMotionEvent_getHistoricalEventTime(const AInputEvent* motion_event,
//        size_t history_index);
func (event *MotionEvent) GetHistoricalEventTime(history_index int) int64 {
	return int64(C.AMotionEvent_getHistoricalEventTime(event.cptr(), C.size_t(history_index)))
}

/* Get the historical raw X coordinate of this event for the given pointer index that
 * occurred between this event and the previous motion event.
 * For touch events on the screen, this is the original location of the event
 * on the screen, before it had been adjusted for the containing window
 * and views.
 * Whole numbers are pixels; the value may have a fraction for input devices
 * that are sub-pixel precise. */
//float AMotionEvent_getHistoricalRawX(const AInputEvent* motion_event, size_t pointer_index,
//        size_t history_index) __NDK_FPABI__;
func (event *MotionEvent) GetHistoricalRawX(pointer_index, history_index int) float32 {
	return float32(C.AMotionEvent_getHistoricalRawX(event.cptr(), C.size_t(pointer_index), C.size_t(history_index)))
}

/* Get the historical raw Y coordinate of this event for the given pointer index that
 * occurred between this event and the previous motion event.
 * For touch events on the screen, this is the original location of the event
 * on the screen, before it had been adjusted for the containing window
 * and views.
 * Whole numbers are pixels; the value may have a fraction for input devices
 * that are sub-pixel precise. */
//float AMotionEvent_getHistoricalRawY(const AInputEvent* motion_event, size_t pointer_index,
//        size_t history_index) __NDK_FPABI__;
func (event *MotionEvent) GetHistoricalRawY(pointer_index, history_index int) float32 {
	return float32(C.AMotionEvent_getHistoricalRawY(event.cptr(), C.size_t(pointer_index), C.size_t(history_index)))
}

/* Get the historical X coordinate of this event for the given pointer index that
 * occurred between this event and the previous motion event.
 * Whole numbers are pixels; the value may have a fraction for input devices
 * that are sub-pixel precise. */
//float AMotionEvent_getHistoricalX(const AInputEvent* motion_event, size_t pointer_index,
//        size_t history_index) __NDK_FPABI__;
func (event *MotionEvent) GetHistoricalX(pointer_index, history_index int) float32 {
	return float32(C.AMotionEvent_getHistoricalX(event.cptr(), C.size_t(pointer_index), C.size_t(history_index)))
}

/* Get the historical Y coordinate of this event for the given pointer index that
 * occurred between this event and the previous motion event.
 * Whole numbers are pixels; the value may have a fraction for input devices
 * that are sub-pixel precise. */
//float AMotionEvent_getHistoricalY(const AInputEvent* motion_event, size_t pointer_index,
//        size_t history_index) __NDK_FPABI__;
func (event *MotionEvent) GetHistoricalY(pointer_index, history_index int) float32 {
	return float32(C.AMotionEvent_getHistoricalY(event.cptr(), C.size_t(pointer_index), C.size_t(history_index)))
}

/* Get the historical pressure of this event for the given pointer index that
 * occurred between this event and the previous motion event.
 * The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure),
 * although values higher than 1 may be generated depending on the calibration of
 * the input device. */
//float AMotionEvent_getHistoricalPressure(const AInputEvent* motion_event, size_t pointer_index,
//        size_t history_index) __NDK_FPABI__;
func (event *MotionEvent) GetHistoricalPressure(pointer_index, history_index int) float32 {
	return float32(C.AMotionEvent_getHistoricalPressure(event.cptr(), C.size_t(pointer_index), C.size_t(history_index)))
}

/* Get the current scaled value of the approximate size for the given pointer index that
 * occurred between this event and the previous motion event.
 * This represents some approximation of the area of the screen being
 * pressed; the actual value in pixels corresponding to the
 * touch is normalized with the device specific range of values
 * and scaled to a value between 0 and 1.  The value of size can be used to
 * determine fat touch events. */
//float AMotionEvent_getHistoricalSize(const AInputEvent* motion_event, size_t pointer_index,
//        size_t history_index) __NDK_FPABI__;
func (event *MotionEvent) GetHistoricalSize(pointer_index, history_index int) float32 {
	return float32(C.AMotionEvent_getHistoricalSize(event.cptr(), C.size_t(pointer_index), C.size_t(history_index)))
}

/* Get the historical length of the major axis of an ellipse that describes the touch area
 * at the point of contact for the given pointer index that
 * occurred between this event and the previous motion event. */
//float AMotionEvent_getHistoricalTouchMajor(const AInputEvent* motion_event, size_t pointer_index,
//        size_t history_index) __NDK_FPABI__;
func (event *MotionEvent) GetHistoricalTouchMajor(pointer_index, history_index int) float32 {
	return float32(C.AMotionEvent_getHistoricalTouchMajor(event.cptr(), C.size_t(pointer_index), C.size_t(history_index)))
}

/* Get the historical length of the minor axis of an ellipse that describes the touch area
 * at the point of contact for the given pointer index that
 * occurred between this event and the previous motion event. */
//float AMotionEvent_getHistoricalTouchMinor(const AInputEvent* motion_event, size_t pointer_index,
//        size_t history_index) __NDK_FPABI__;
func (event *MotionEvent) GetHistoricalTouchMinor(pointer_index, history_index int) float32 {
	return float32(C.AMotionEvent_getHistoricalTouchMinor(event.cptr(), C.size_t(pointer_index), C.size_t(history_index)))
}

/* Get the historical length of the major axis of an ellipse that describes the size
 * of the approaching tool for the given pointer index that
 * occurred between this event and the previous motion event.
 * The tool area represents the estimated size of the finger or pen that is
 * touching the device independent of its actual touch area at the point of contact. */
//float AMotionEvent_getHistoricalToolMajor(const AInputEvent* motion_event, size_t pointer_index,
//        size_t history_index) __NDK_FPABI__;
func (event *MotionEvent) GetHistoricalToolMajor(pointer_index, history_index int) float32 {
	return float32(C.AMotionEvent_getHistoricalToolMajor(event.cptr(), C.size_t(pointer_index), C.size_t(history_index)))
}

/* Get the historical length of the minor axis of an ellipse that describes the size
 * of the approaching tool for the given pointer index that
 * occurred between this event and the previous motion event.
 * The tool area represents the estimated size of the finger or pen that is
 * touching the device independent of its actual touch area at the point of contact. */
//float AMotionEvent_getHistoricalToolMinor(const AInputEvent* motion_event, size_t pointer_index,
//        size_t history_index) __NDK_FPABI__;
func (event *MotionEvent) GetHistoricalToolMinor(pointer_index, history_index int) float32 {
	return float32(C.AMotionEvent_getHistoricalToolMinor(event.cptr(), C.size_t(pointer_index), C.size_t(history_index)))
}

/* Get the historical orientation of the touch area and tool area in radians clockwise from
 * vertical for the given pointer index that
 * occurred between this event and the previous motion event.
 * An angle of 0 degrees indicates that the major axis of contact is oriented
 * upwards, is perfectly circular or is of unknown orientation.  A positive angle
 * indicates that the major axis of contact is oriented to the right.  A negative angle
 * indicates that the major axis of contact is oriented to the left.
 * The full range is from -PI/2 radians (finger pointing fully left) to PI/2 radians
 * (finger pointing fully right). */
//float AMotionEvent_getHistoricalOrientation(const AInputEvent* motion_event, size_t pointer_index,
//        size_t history_index) __NDK_FPABI__;
func (event *MotionEvent) GetHistoricalOrientation(pointer_index, history_index int) float32 {
	return float32(C.AMotionEvent_getHistoricalOrientation(event.cptr(), C.size_t(pointer_index), C.size_t(history_index)))
}

/* Get the historical value of the request axis for the given pointer index
 * that occurred between this event and the previous motion event. */
//float AMotionEvent_getHistoricalAxisValue(const AInputEvent* motion_event,
//        int32_t axis, size_t pointer_index, size_t history_index) __NDK_FPABI__;
func (event *MotionEvent) GetHistoricalAxisValue(axis, pointer_index, history_index int) float32 {
	return float32(C.AMotionEvent_getHistoricalAxisValue(event.cptr(), C.int32_t(axis), C.size_t(pointer_index), C.size_t(history_index)))
}

/*
 * Input queue
 *
 * An input queue is the facility through which you retrieve input
 * events.
 */
type InputQueue C.AInputQueue

func (queue *InputQueue) cptr() *C.AInputQueue {
	return (*C.AInputQueue)(queue)
}

/*
 * Add this input queue to a looper for processing.  See
 * ALooper_addFd() for information on the ident, callback, and data params.
 */
//void AInputQueue_attachLooper(AInputQueue* queue, ALooper* looper,
//        int ident, ALooper_callbackFunc callback, void* data);
type callbackParam struct {
	callback LooperCallback
	data     unsafe.Pointer
}

//export cgoCallback
func cgoCallback(fd, events int, data unsafe.Pointer) int {
	param := (*callbackParam)(data)
	return param.callback(fd, events, param.data)
}

func (queue *InputQueue) AttachLooper(looper *Looper, ident int, callback LooperCallback, data unsafe.Pointer) {
	if callback != nil {
		C.AInputQueue_attachLooper(queue.cptr(), looper.cptr(),
			C.int(ident), (C.ALooper_callbackFunc)(C.cgoCallback),
			unsafe.Pointer(&callbackParam{callback, data}))
	} else {
		C.AInputQueue_attachLooper(queue.cptr(), looper.cptr(),
			C.int(ident), nil, data)
	}
}

/*
 * Remove the input queue from the looper it is currently attached to.
 */
//void AInputQueue_detachLooper(AInputQueue* queue);
func (queue *InputQueue) DetachLooper() {
	C.AInputQueue_detachLooper(queue.cptr())
}

/*
 * Returns true if there are one or more events available in the
 * input queue.  Returns 1 if the queue has events; 0 if
 * it does not have events; and a negative value if there is an error.
 */
//int32_t AInputQueue_hasEvents(AInputQueue* queue);
func (queue *InputQueue) HasEvents() bool {
	return 1 == C.AInputQueue_hasEvents(queue.cptr())
}

/*
 * Returns the next available event from the queue.  Returns a negative
 * value if no events are available or an error has occurred.
 */
//int32_t AInputQueue_getEvent(AInputQueue* queue, AInputEvent** outEvent);
func (queue *InputQueue) GetEvent() *InputEvent {
	var outEvent *C.AInputEvent
	if C.AInputQueue_getEvent(queue.cptr(), &outEvent) >= 0 {
		return (*InputEvent)(outEvent)
	}
	return nil
}

/*
 * Sends the key for standard pre-dispatching -- that is, possibly deliver
 * it to the current IME to be consumed before the app.  Returns 0 if it
 * was not pre-dispatched, meaning you can process it right now.  If non-zero
 * is returned, you must abandon the current event processing and allow the
 * event to appear again in the event queue (if it does not get consumed during
 * pre-dispatching).
 */
//int32_t AInputQueue_preDispatchEvent(AInputQueue* queue, AInputEvent* event);
func (queue *InputQueue) PreDispatchEvent(event *InputEvent) bool {
	return 0 != C.AInputQueue_preDispatchEvent(queue.cptr(), event.cptr())
}

/*
 * Report that dispatching has finished with the given event.
 * This must be called after receiving an event with AInputQueue_get_event().
 */
//void AInputQueue_finishEvent(AInputQueue* queue, AInputEvent* event, int handled);
func (queue *InputQueue) FinishEvent(event *InputEvent, handled int) {
	C.AInputQueue_finishEvent(queue.cptr(), event.cptr(), C.int(handled))
}
